<template>
  <div v-for="(item, index) in data" :key="index">
      {{ item.name }}
      <TreeItem v-if="item?.children?.length" :data="item.children"></TreeItem> 
  </div>
</template>

<script setup lang='ts'>
import TreeItem from './tree.vue'
import type { TreeList } from './tree'

type Props = {
    data?:TreeList[]
}

defineProps<Props>()

</script>

<script lang='ts'>
export default {
    name:'TreeItem'
}
</script>

<style lang='scss' scoped>

</style>
